package com.bestcem.xm.deliver.grpc.client.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;
import java.util.List;

@Data
@NoArgsConstructor
public class MemberDto {
    @JsonProperty("orgId")
    private String orgId;
    @JsonProperty("sysId")
    private String sysId;
    @JsonProperty("memberNo")
    private String memberNo;
    @JsonProperty("mtype")
    private Integer memberType;
    @JsonProperty("store")
    private String store;
    @JsonProperty("openid")
    private String openId;
    @JsonProperty("appid")
    private String appId;
    @JsonProperty("alipay_user_id")
    private String alipayUserId;
    @JsonProperty("employeeID")
    private String employeeId;
    @JsonProperty("institut_name")
    private String institutName;
    @JsonProperty("institutID")
    private String institutId;
    @JsonProperty("department")
    private String departmentName;
    @JsonProperty("position")
    private String positionName;
    @JsonProperty("field_val_list")
    private List<ExtendFieldValueDto> fieldValuesList;
    @JsonProperty("userId")
    private String userId;
    @JsonProperty("labels")
    private List<LabelValueDto> labelValuesList;
    @JsonProperty("employee_status")
    private Integer employeeStatus;
    @JsonProperty("out_no")
    private String outNo;
    @JsonProperty("address")
    private List<String> addressesList;

    @JsonProperty("id")
    private String id;
    @JsonProperty("source")
    private Integer source;
    @JsonProperty("name")
    private String name;
    @JsonProperty("email")
    private String email;
    @JsonProperty("phone")
    private String phone;
    @JsonProperty("mobile")
    private String mobile;
    @JsonProperty("gender")
    private String gender;
    @JsonProperty("nickname")
    private String nickname;
    @JsonProperty("region")
    private String region;
    @JsonProperty("status")
    private Integer status;
    @JsonProperty("content")
    private String content;
    @JsonProperty("birthday")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy/MM/dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime birthday;
    @JsonProperty("age")
    private Integer age;

    @JsonProperty("user_group_code")
    private String userGroupCode;

    @JsonProperty("member_delivery_status")
    private Integer memberDeliveryStatus;

    @JsonProperty("subscribe_status")
    private Integer subscribeStatus;

    @Data
    @NoArgsConstructor
    public static class ExtendFieldValueDto {
        @JsonProperty("id")
        private String id;
        @JsonProperty("field_name")
        private String name;
        @JsonProperty("field_value")
        private String value;
        @JsonProperty("f_type")
        private Integer type;
        @JsonProperty("field_id")
        private String fieldId;
    }

    @Data
    @NoArgsConstructor
    public static class LabelValueDto {
        @JsonProperty("id")
        private String id;
        @JsonProperty("label_id")
        private String labelId;
        @JsonProperty("label_name")
        private String labelName;
        @JsonProperty("value")
        private String value;
    }
}
